<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>FlexLoggerSample.mxml</title>
<link rel="stylesheet" type="text/css" href="../../SourceStyles.css"/>
</head>

<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version=&quot;1.0&quot;?&gt;</span>
<span class="MXMLComponent_Tag">&lt;mx:Application</span><span class="MXMLDefault_Text"> xmlns:mx=&quot;</span><span class="MXMLString">http://www.adobe.com/2006/mxml</span><span class="MXMLDefault_Text">&quot; viewSourceURL=&quot;</span><span class="MXMLString">srcview/index.html</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;mx:Script&gt;</span>
        <span class="ActionScriptOperator">&lt;!</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">CDATA</span><span class="ActionScriptBracket/Brace">[</span>
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">rpc</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">ResultEvent</span>;
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">rpc</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">FaultEvent</span>;

            <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span>
            <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">latitude</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;
            <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span>
            <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">longitude</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;

            <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ResultEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span><span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">debug</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">result</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">result</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">XMLList</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">result</span>.<span class="ActionScriptDefault_Text">listLatLonOut</span>.<span class="ActionScriptDefault_Text">length</span><span class="ActionScriptBracket/Brace">()){</span>
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">xml</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">XML</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">XML</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">unescape</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">result</span>.<span class="ActionScriptDefault_Text">listLatLonOut</span><span class="ActionScriptBracket/Brace">))</span>;
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">latLon</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">xml</span>.<span class="ActionScriptDefault_Text">latLonList</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span>;
                    <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">latLon</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">latLon</span>.<span class="ActionScriptDefault_Text">indexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;,&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptOperator">-</span>1<span class="ActionScriptBracket/Brace">){</span>
                        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">params</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">latLon</span>.<span class="ActionScriptDefault_Text">split</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;,&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
                        <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">params</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">params</span><span class="ActionScriptBracket/Brace">)</span>;
                        <span class="ActionScriptDefault_Text">latitude</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">params</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span>;
                        <span class="ActionScriptDefault_Text">longitude</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">params</span><span class="ActionScriptBracket/Brace">[</span>1<span class="ActionScriptBracket/Brace">]</span>;
                        <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">warn</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;latitude=&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">latitude</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;, longitude=&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">longitude</span><span class="ActionScriptBracket/Brace">)</span>;
                        <span class="ActionScriptDefault_Text">WS</span>.<span class="ActionScriptDefault_Text">NDFDgenByDay</span>.<span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">()</span>;
                        <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">alert</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Check Flex Logger&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptBracket/Brace">}</span><span class="ActionScriptReserved">else</span><span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">warn</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Invalid xml output:&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">xml</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptBracket/Brace">}</span><span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">result</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">XMLList</span><span class="ActionScriptBracket/Brace">){</span>
                    <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">info</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">unescape</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">result</span>.<span class="ActionScriptDefault_Text">children</span><span class="ActionScriptBracket/Brace">()))</span>;
                    <span class="ActionScriptDefault_Text">WS</span>.<span class="ActionScriptDefault_Text">TriggerFaultUnknownOparator</span>.<span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">()</span>;
                <span class="ActionScriptBracket/Brace">}</span><span class="ActionScriptReserved">else</span><span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">error</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Unexpected  result information&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">FaultEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span><span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Logger</span>.<span class="ActionScriptDefault_Text">error</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">fault</span>.<span class="ActionScriptDefault_Text">faultString</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">]]</span><span class="ActionScriptOperator">&gt;</span>

    <span class="MXMLSpecial_Tag">&lt;/mx:Script&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> text=&quot;</span><span class="MXMLString">Enter zip code:</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:TextInput</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">zipcode</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">94040</span><span class="MXMLDefault_Text">&quot; maxChars=&quot;</span><span class="MXMLString">5</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> text=&quot;</span><span class="MXMLString">Number of days:</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:TextInput</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">numDays</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">5</span><span class="MXMLDefault_Text">&quot; maxChars=&quot;</span><span class="MXMLString">2</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Button</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">Submit</span><span class="MXMLDefault_Text">&quot; click=&quot;</span><span class="ActionScriptDefault_Text">WS</span>.<span class="ActionScriptDefault_Text">LatLonListZipCode</span>.<span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>

    <span class="MXMLComponent_Tag">&lt;mx:WebService</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">WS</span><span class="MXMLDefault_Text">&quot; wsdl=&quot;</span><span class="MXMLString">http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl</span><span class="MXMLDefault_Text">&quot;
        useProxy=&quot;</span><span class="MXMLString">false</span><span class="MXMLDefault_Text">&quot; fault=&quot;</span><span class="ActionScriptDefault_Text">onFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">&quot; result=&quot;</span><span class="ActionScriptDefault_Text">onResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">&quot; </span><span class="MXMLComponent_Tag">&gt;</span>
        
        <span class="MXMLComponent_Tag">&lt;mx:operation</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">LatLonListZipCode</span><span class="MXMLDefault_Text">&quot; resultFormat=&quot;</span><span class="MXMLString">e4x</span><span class="MXMLDefault_Text">&quot; </span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:request&gt;</span>
                <span class="MXMLComponent_Tag">&lt;zipCodeList&gt;</span>{<span class="ActionScriptDefault_Text">zipcode</span>.<span class="ActionScriptDefault_Text">text</span>}<span class="MXMLComponent_Tag">&lt;/zipCodeList&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:request&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/mx:operation&gt;</span>

        <span class="MXMLComponent_Tag">&lt;mx:operation</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">NDFDgenByDay</span><span class="MXMLDefault_Text">&quot; resultFormat=&quot;</span><span class="MXMLString">e4x</span><span class="MXMLDefault_Text">&quot; </span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:request&gt;</span>
                <span class="MXMLComponent_Tag">&lt;latitude&gt;</span>{<span class="ActionScriptDefault_Text">latitude</span>}<span class="MXMLComponent_Tag">&lt;/latitude&gt;</span>
                <span class="MXMLComponent_Tag">&lt;longitude&gt;</span>{<span class="ActionScriptDefault_Text">longitude</span>}<span class="MXMLComponent_Tag">&lt;/longitude&gt;</span>
                <span class="MXMLComponent_Tag">&lt;startDate&gt;</span>today<span class="MXMLComponent_Tag">&lt;/startDate&gt;</span>
                <span class="MXMLComponent_Tag">&lt;numDays&gt;</span>{<span class="ActionScriptDefault_Text">numDays</span>.<span class="ActionScriptDefault_Text">text</span>}<span class="MXMLComponent_Tag">&lt;/numDays&gt;</span>
                <span class="MXMLComponent_Tag">&lt;format&gt;</span>24 hourly<span class="MXMLComponent_Tag">&lt;/format&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:request&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/mx:operation&gt;</span>

    <span class="MXMLComponent_Tag">&lt;/mx:WebService&gt;</span>
<span class="MXMLComponent_Tag">&lt;/mx:Application&gt;</span></pre></body>
</html>
